package com.oim.fx.ui.component;

import javafx.geometry.Insets;
import javafx.scene.control.Button;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;

/**
 * @author: XiaHui
 * @date: 2017年6月1日 下午3:01:06
 */
public class IconStyleButton extends Button {

	ImageView imageView = new ImageView();

	public IconStyleButton() {
		initIconStyleButton();
		initEvent();
	}

	private void initIconStyleButton() {
		this.setFocusTraversable(false);
		//this.setGraphicTextGap(1);
		this.setPadding(new Insets(3, 6, 3, 6));
		this.getStyleClass().add("icon-1-button");
		this.setGraphic(imageView);
		
	}

	private void initEvent() {

		this.hoverProperty().addListener(h -> {

		});
		
		this.pressedProperty().addListener(p -> {

		});
	}

	public void setImage(Image value) {
		imageView.setImage(value);
	}
}
